---
id: 6626a060c4006f793e10cb33
title: Step 2
challengeType: 1
dashedName: step-2
---

# --description--

Now the teacher needs your help converting the student score to a letter grade.

Complete the `getGrade` function that takes a number `score` as a parameter. Your function should return a string representing a letter grade based on the score.

Here are the scores and their corresponding letter grades:

| Score Range | Grade   |
| ----------- | ------- |
| `100`       | `"A++"` |
| `90 - 99`   | `"A"`   |
| `80 - 89`   | `"B"`   |
| `70 - 79`   | `"C"`   |
| `60 - 69`   | `"D"`   |
| `0 - 59`    | `"F"`   |


**Tips**

- Remember that you learned about conditional statements(`if`, `else if`, and `else`).
- Remember that you learned about comparison operators (`>`, `<`, `>=`, `<=`, `===`).

# --hints--

Your `getGrade` function should return `"A++"` if the score is `100`.

```js
assert.strictEqual(getGrade(100), "A++");
```

Your `getGrade` function should return `"A"` if the score is `94`.

```js
assert.strictEqual(getGrade(94), "A");
```

Your `getGrade` function should return `"B"` if the score is between `80` and `89`.

```js
assert.strictEqual(getGrade(80), "B");
assert.strictEqual(getGrade(83), "B");
assert.strictEqual(getGrade(88), "B");
```

Your `getGrade` function should return `"C"` if the score is `78`.

```js
assert.strictEqual(getGrade(75), "C");
```

Your `getGrade` function should return `"D"` if the score is between `60` and `69`.

```js
assert.strictEqual(getGrade(60), "D");
assert.strictEqual(getGrade(63), "D");
assert.strictEqual(getGrade(68), "D");
```

Your `getGrade` function should return `"F"` if the score is `57`.

```js
assert.strictEqual(getGrade(57), "F");
```

Your `getGrade` function should return `"F"` if the score is between `0` and `59`.

```js
assert.strictEqual(getGrade(0), "F");
assert.strictEqual(getGrade(30), "F");
assert.strictEqual(getGrade(43), "F");
```

# --seed--

## --seed-contents--

```js
function getAverage(scores) {
  let sum = 0;

  for (const score of scores) {
    sum += score;
  }

  return sum / scores.length;
}
--fcc-editable-region--
function getGrade(score) {

}

console.log(getGrade(96));
console.log(getGrade(82));
console.log(getGrade(56));
--fcc-editable-region--
```
